package stu.sup.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import stu.sup.entity.UserLogin;
import stu.sup.entity.UserLoginExample;

public interface UserLoginMapper {
    int countByExample(UserLoginExample example);

    int deleteByExample(UserLoginExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(UserLogin record);

    int insertSelective(UserLogin record);

    List<UserLogin> selectByExample(UserLoginExample example);

    UserLogin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") UserLogin record, @Param("example") UserLoginExample example);

    int updateByExample(@Param("record") UserLogin record, @Param("example") UserLoginExample example);

    int updateByPrimaryKeySelective(UserLogin record);

    int updateByPrimaryKey(UserLogin record);

    @Select("select * from user_login where username=#{username}")
    UserLogin selectByUserName(String username);

    //keyProperty：设置为对象id属性名称。
    //keyColumn：设置为数据库记录的主键id字段名称
//    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
//    @Insert("insert into user_login(username,password,telephone) values (#{username},#{password},#{telephone})")
    UserLogin register(String username, String password,String telephone);


}